﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace S7Lib.Base
{
    public static class Status
    {
        public static Dictionary<ushort, string> HeaderErrors = new Dictionary<ushort, string>()
        {
            { 0x0110,"无效块类型编号" },
            { 0x0112,"无效参数" },
            { 0x011A,"PG资源错误" },
            { 0x011B,"PLC重新外包错误" },
            { 0x011C,"协议错误" },
            { 0x011F,"用户缓冲区太短" },
            { 0x0141,"请求错误" },
            { 0x01C0,"版本不匹配" },
            { 0x01F0,"末实施" },
            { 0x8001,"L7无效CPU状态" },
            // .......自行补齐
        };

        public static Dictionary<byte, string> DataReturnCode = new Dictionary<byte, string>()
        {
            { 0xff,"请求成功"},
            { 0x01,"硬件错误"},
            { 0x03,"对象不允许访问"},
            { 0x05,"地址越界，所需的地址超出此PLC的极限"},
            { 0x06,"请求的数据类型与存储类型不一致"},
            { 0x07,"日期类型不一致"},
            { 0x0a,"对象不存在"}
        };
    }
}
